package com.csun.dsms.service.impl;

import com.csun.dsms.comment.core.support.BaseService;
import com.csun.dsms.mapper.IhgUserMapper;
import com.csun.dsms.mapper.JyUserMapper;
import com.csun.dsms.model.education.JyQueryDto;
import com.csun.dsms.model.education.JyUser;
import com.csun.dsms.model.huang.IHgQueryDto;
import com.csun.dsms.model.huang.IhgUser;
import com.csun.dsms.service.IHgUserService;
import com.csun.dsms.service.JyUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class JyUserServiceImpl extends BaseService<JyUser> implements JyUserService {

    @Resource
    private JyUserMapper jyUserMapper;

    @Override
    public JyUser loginByPhone(String phone) {
        JyUser jyUser = jyUserMapper.selectUserByPhone(phone);
        return jyUser;
    }


    @Override
    public Integer addUser(JyUser hgUser) {
        return jyUserMapper.insert(hgUser);
    }

    @Override
    public List<JyUser> queryList(JyQueryDto iHgQueryDto) {
        return jyUserMapper.queryListWithPage(iHgQueryDto);
    }

    @Override
    public Integer editUser(JyUser hgUser) {
        return jyUserMapper.updateByPrimaryKey(hgUser);
    }

    @Override
    public JyUser selectByPhone(String phone) {
        return jyUserMapper.selectUserByPhone(phone);
    }
}
